<template>
  <view class="test-content relative">
    <mp-html :content="data.content" :preview-img="false" />
    <u-button class="animate__animated animate__pulse test-button" type="error">立即测试</u-button>
  </view>
</template>

<script>
import { index } from '~/api/test'

export default {
  data() {
    return {
      // 数据
      pid: 0,
      data: {},
    }
  },
  onLoad(query) {
    this.id = query.id
    this.getIndex(this.id)
  },
  methods: {
    // 事件
    getIndex(pid) {
      index(pid).then((res) => {
        this.data = res.data
      })
    },
  },
}
</script>

<style lang='scss'>
@import '@/uni_modules/dk-diy-page/components/dk-diy-box/animate.css';

.test-content {
  .test-button {
    position: absolute;
    bottom: 0;
    left: 10%;
    right: 10%;
    animation-delay: 0s;
    animation-duration: 1s;
    animation-iteration-count: infinite;
  }
}
</style>
